import Vue from 'vue';
import Router from 'vue-router';
import BlogView from '@/views/BlogView';
import HomeView from '@/views/HomeView';
import AboutView from '@/views/AboutView';
import ToolboxView from '@/views/ToolboxView';
import PortfolioView from '@/views/PortfolioView';
import ContestAigcView from '@/views/ContestAigcView';
import ContestMobileView from '@/views/ContestMobileView';
import QuestionView from '@/views/Toolbox/QuestionView';

Vue.use(Router);

export default new Router({
	routes: [{
			path: '/',
			redirect: '/home' // 添加重定向
		},
		{
			path: '/home',
			name: 'Home',
			component: HomeView
		},
		{
			path: '/blog',
			name: 'Blog',
			component: BlogView
		},
		{
			path: '/about',
			name: 'About',
			component: AboutView
		},
		{
			path: '/contestaigc',
			name: 'contestaigc',
			component: ContestAigcView
		},
		{
			path: '/contestmobile',
			name: 'contestmobile',
			component: ContestMobileView
		},
		
		{
			path: '/toolbox',
			name: 'Toolbox',
			component: ToolboxView
		},
		  {
		    path: '/toolbox/question/:id',
		    name: 'question',
		    component: QuestionView,
		    props: true
		  },
		    {
		      path: '/toolbox/question/wrong/:id',
		      name: 'WrongQuestionsPractice',
		      component: () => import('@/views/Toolbox/QuestionWrongView') // 假设组件放在 views 文件夹中
		    },
		{
			path: '/portfolio',
			name: 'Portfolio',
			component: PortfolioView
		},
	]
});
